package com.yunban.project.api.text_check.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.Fastjson2TypeHandler;
import com.yunban.project.api.text_check.enums.CorrectionModel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import net.lab1024.sa.base.ProjectConstants;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author: lijiajun
 * @date: 2024-11-19
 * @version: 1.0
 */
@Data
@Schema(description = "文本纠错历史记录")
@TableName(value = ProjectConstants.TEXT_TABLE_PREFIX + "correction_history", autoResultMap = true)
public class CorrectionHistory implements Serializable {

    @Serial
    private final static long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    @Schema(description = "主键ID")
    private Long id;

    @Schema(description = "解析类型")
    private CorrectionModel parseType;

    @Schema(description = "文件word类型")
    private String fileName;

    @Schema(description = "文件MD5")
    private String fileMd5;

    @Schema(description = "原始文本")
    private String originalText;

    @Schema(description = "纠错文本")
    private String correctedText;

    @Schema(description = "分词信息")
    @TableField(typeHandler = Fastjson2TypeHandler.class)
    private List<String> tokenizedList;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;
}
